package com.example.myapplication;

import android.app.IntentService;
import android.content.Intent;
import android.support.annotation.Nullable;
import android.util.Log;

/**
 * Created by Lx on 2018/9/17.
 */

public class MyIntentService extends IntentService {
    /**
     * Creates an IntentService.  Invoked by your subclass's constructor.
     *
     * @param name Used to name the worker thread, important only for debugging.
     */

    /**
     * 是否正在运行
     */
    private boolean isRunning;
    /**
     *进度
     */
    private int count;
   public static  seiviceUpdate update;

    public MyIntentService() {
        super("MyIntentService");
        Log.e("MyIntentService","初始化了");
    }

    @Override
    protected void onHandleIntent(@Nullable Intent intent) {
        Log.e("onHandleIntent","执行了");
            if (update!=null){
                for (int i=0;i<=60;i++){
                    update.upUI(i);
                    Log.e("onHandleIntent",""+i);
                }


        }
    }
    public  void setService(seiviceUpdate update1){
        update=update1;
    }
    public interface  seiviceUpdate{
        void upUI(int number);
    }
}
